import { useEffect, useState } from 'react';
import { IRouteComponentProps } from 'umi';
import useStore from '@/context/useStore';
import './interviewRecord.less'
import { observer } from 'mobx-react-lite'
import {Button,message} from 'antd'
const issoundrecord=['无','有']
const status = ['不确定', '通过', '未通过' ];
const interviewRecord:React.FC<IRouteComponentProps>=({location,history})=>{
   let id=location.query.interviewId
   let [flag,setflag]=useState(false)
  let { InterRecord } = useStore();
    useEffect(()=>{
      InterRecord.getinterRecord(id as string)
    },[])
    const success = () => {
      setflag(!false)
      if(flag){
        message.success('取消屏蔽')
      }else{
        message.success('屏蔽成功');
      }
     
    };
    return <div>
       
      <Button onClick={()=>{history.go(-1)}}>返回</Button>
      <Button type="primary" onClick={success}>屏蔽</Button>
      <div className="inter">    
      <div className='left'>
      <span><b>岗位名称:</b> {InterRecord.interDetail.stationName}</span>
      <span><b>面试时间:</b>{InterRecord.interDetail.interviewTime}</span>
      <span><b>地点:</b>{InterRecord.interDetail.site}</span>
      <span><b>专业:</b>{InterRecord.interDetail.majorName}</span>
      <span><b>记录-吐槽:</b>{InterRecord.interDetail.record}</span>
      <span><b>录音文件:</b>{issoundrecord[InterRecord.interDetail.issoundrecord]}</span>
      <span><b>面试问题:</b>请如实填写面试问题和答案，面试中没有作答的题目可略过答案填写，直接输入问题即可。</span>
      <span></span>
      </div>
     <div>
      <span><b>公司名称:</b>{InterRecord.interDetail.companyName}</span>
      <span><b>时长:</b>{InterRecord.interDetail.duration}</span>
      <span><b>面试官:</b>{InterRecord.interDetail.intervierManagement}</span>  
      <span><b>提交人:</b>{InterRecord.interDetail.commitName}</span>
      <span><b>面试结果:</b>{status[InterRecord.interDetail.status]}</span>
      </div>
      {flag ? <div className='record'>
          <img src="http://111.203.59.61:8060/static/img/shield.69691644.svg" alt="" />
      </div> :'取消屏蔽'}
    </div>
    </div>
    
}
export default observer(interviewRecord)
